#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

//和为S的连续正数序列
vector<vector<int>> FindContinuousSequence(int num)
{
    vector<vector<int>> res;
    vector<int> start;
    for (int i = 1; i <= num; ++i)
    {
        int b = 2 * i - 1;
        float x = (-b + sqrt(b * b + 8 * num)) / 2; //x为序列的长度
        if (x - (int)x == 0 && x > 1)
        {
            start.push_back(i); //i为序列的起始数字
        }
    }
    for (int i = 0; i < start.size(); ++i)
    {
        int begin = start[i];
        int sum = 0;
        vector<int> tmp;
        for (int j = begin; sum < num; ++j)
        {
            sum += j;
            tmp.push_back(j);
        }
        res.push_back(tmp);
    }
    return res;
}

void test()
{
    FindContinuousSequence(3);
}

int main()
{
    test();
    return 0;
}